<template>
  <component
    :is="typeComponentMap[type]"
    :height="height"
    :option="option"
    :dataZoom="dataZoom"
    class="v-charts"
  />
</template>
<script lang="ts" setup>
import radar from "./components/RadarCharts.vue";
defineOptions({ name: "Charts" });
defineProps({
  type: {
    type: String,
    default: "radar",
  },
  height: {
    type: String,
    default: "200px",
  },
  dataZoom: Boolean,
  option: {
    type: Object,
    required: true,
  }, // { title , xData, yData, formatStr  }
});

const typeComponentMap = { radar } as any;
</script>
